package models

type SysRole struct {
	ID
	Name   string    `json:"name" gorm:"type:varchar(50);not null;unique;comment:角色名称"`
	Code   string    `json:"code" gorm:"type:varchar(50);not null;unique;comment:角色编码"`
	Status int       `json:"status" gorm:"default:1;comment:状态 1:启用 0:禁用"`
	Remark string    `json:"remark" gorm:"type:varchar(255);comment:备注"`
	Users  []SysUser `json:"users" gorm:"many2many:sys_user_roles;foreignKey:ID;joinForeignKey:RoleId;References:ID;joinReferences:UserId"`
	Sort   int       `json:"sort" gorm:"default:0;comment:排序"`
	Menus  []SysMenu `json:"menus" gorm:"many2many:sys_role_menus;foreignKey:ID;joinForeignKey:RoleId;References:ID;joinReferences:MenuId"`
	Timestamps
	SoftDeletes
}
